package com.gitee.wsl.compose.chart.frond

import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.shadow
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.compose.ui.window.Popup

/**
 *     var backgroundColor: Any? = null
 *     var borderColor: String? = null
 *     var borderRadius: Number? = null
 *     var borderWidth: Number? = null
 *     var style: AAStyle? = null
 *     var shape: String? = null
 *     var enabled: Boolean? = null
 *     var useHTML: Boolean? = null
 *     var formatter: String? = null
 *     var headerFormat: String? = null
 *     var pointFormat: String? = null
 *     var footerFormat: String? = null
 *     var valueDecimals: Int? = null
 *     var shared: Boolean? = null
 *     var valueSuffix: String? = null
 *     var followTouchMove: Boolean? = null //https://api.highcharts.com.cn/highcharts#chart.panning
 *     var shadow: Boolean? = null
 *     var padding: Number? = null
 *     var pointFormatter: String? = null
 *     var positioner: String? = null
 *     var dateTimeLabelFormats: AADateTimeLabelFormats? = null
 *
 */

@Composable
fun Tooltip(text: String) {
    Popup(
        alignment = Alignment.TopStart,
    ) {
        Surface(
            modifier =
                Modifier
                    .shadow(4.dp)
                    .padding(4.dp),
            color = Color.White,
            shape = RoundedCornerShape(4.dp),
        ) {
            Text(
                text = text,
                modifier = Modifier.padding(8.dp),
                fontSize = 12.sp,
            )
        }
    }
}